package com.sqk.reggie.common;

/**
 * 基于ThreadLocal封装的工具类，保存和获取当前登录员工id
 */
public class BaseContext {

    //创建静态ThreadLocal
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    //设置当前登录员工的id
    public static void setCurrentId(long id) { threadLocal.set(id); }

    //获取当前登录员工的id
    public static Long getCurrentId() { return threadLocal.get();
    }

}
